<template>
  <el-dialog
    title="添加楼栋信息"
    :visible.sync="visible"
    @closed="dialogCloseHandler"
    append-to-body
    style="overflow:hidden;margin-top: -5vh"
    :close-on-click-modal="false"
    class="zcgl-fjgl-add-warp"
  >
    <el-form
      :model="formData"
      :ref="editFormRef"
      :rules="rules"
      class="edit-form live-manage-info-audience"
      label-width="110px"
    >
      <el-row :gutter="20">
        <el-col :span="20">
          <el-form-item label="楼层名称：" prop="ldName">
            <el-input
              :disabled="readonly"
              maxlength="30"
              placeholder="请输入楼层名称"
              v-model="formData.ldName"
            ></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="20">
          <el-form-item label="楼层备注：" prop="remark">
            <el-input
              :disabled="!!parentParam.id"
              placeholder="请输入楼层备注"
              type="textarea"
              :autosize="{ minRows: 2, maxRows: 5}"
              v-model="formData.remark"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="20" v-if="parentParam.title=='parents'">
          <el-form-item label="楼层平面图：" prop="planImg">
            <upload-image url="http://xxxxxxx" multiple v-model="formData.planImg" :max="3">
              <span slot="tip">每张图片最大2M，最多允许上传3张图片</span>
            </upload-image>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template slot="footer">
      <el-button @click="dialogCloseHandler" class="button-wide" type="info">关闭</el-button>
      <el-button @click="submitHandler" class="button-wide" v-if="!readonly" type="primary">添加</el-button>
    </template>
  </el-dialog>
</template>

<script>
export default JBoot({
  data() {
    return {
      moduleName: "fjgl",
      submitMethod: "saveLdData",
      rules: {
        ldName: [{ required: true, trigger: "blur", message: "请输入楼栋名称" }],
        planImg:[{ required: true, trigger: "blur", message: "请选择上传楼层平面图" }],
      }
    };
  },
  mounted() {},
  methods: {}
})
  .form()
  .build();
</script>